﻿using EasyLanguage.Data.Contracts.Repository;
using EasyLanguage.Model;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyLanguage.DataAccess.Repository
{
    public class AccountRepository : EFRepository<Account>, IAccountRepository
    {
        public AccountRepository(DbContext dbContext) : base(dbContext){}

        public void SaveAccount(Account account)
        {
            Add(account);
        }

        public Account GetByUserNameAndPassword(string userName, string password)
        {
            return DbSet.SingleOrDefault(x => x.Login == userName && x.Password == password);
        }
    }
}
